package org.example.springaop02.staticProxy;

import org.example.springaop02.calculator.MathCalculator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


//代理
@Component
public class MathProxy implements MathCalculator{
    MathCalculator mathCalculator;



    public MathProxy(MathCalculator mathCalculator){
        this.mathCalculator = mathCalculator;
    }


    @Override
    public int add(int i, int j) {
        System.out.println("日志");
        return mathCalculator.add(i,j);
    }

    @Override
    public int sub(int i, int j) {
        return mathCalculator.sub(i,j);
    }

    @Override
    public int mul(int i, int j) {
        return mathCalculator.mul(i,j);
    }

    @Override
    public int div(int i, int j) {
        return mathCalculator.div(i,j);
    }
}
